<?PHP
include '../ajax_constants.php';

$conf->debug=false;

	$w[0]='user_hash';
	$w[1]=$_GET['user_hash'];
	$w[2]='=';
	$where[]=$w;
	$w[0]='user_ip';
	$w[1]=$_SERVER['REMOTE_ADDR'];
	$w[2]='=';
	$where[]=$w;
	$data=get_sql('active_user','user_name',$where,NULL);
	
	if(!empty($data))
	{
		echo '1';
	}
	else
	{
		echo '0';
	}
		$post['user_name']=randomchar();
		//$post['user_last']="now()";
		process_sql_post($post,'active_user','update','user_hash',$_GET['user_hash']);
		setcookie("cook_name", $_COOKIE['cook_name'], time()+2, "/");
  	 	setcookie("cook_id",   $_COOKIE['cookid'],   time()+2, "/");
	
//	process_sql_post($post,'active_user','replace','id');
?>

